Wiki

Clone wiki

Geko's Lasers / Laser Relays

Laser Relays

Laser Relays are used to both redirect lasers, as well as transmit items and RF through lasers.

If a laser hits a relay, the relay will immediately redirect the laser. All properties of the laser will be kept.

Laser relays will default to face you when placed, but can be rotated by sneak + rightclicking with either an empty hand, or a ThermalExpansion hammer.

SCREENSHOT

Crafting

DETAILS

Transmitting Items and Power

If items or RF is piped into the relay (through something like a hopper, itemducts, or fluxducts), the relay will (on the next tick), fire a red laser, containing all items and power in the relay. These lasers cannot break any blocks, but will pierce through up to 5 blocks.

Items

A laser carrying an item stack will try to deposit its contents into the first inventory it hits. Anything that cannot fit into the inventory WILL be dumped on the ground. If these lasers are destroyed in any way (such as hitting a mob or player, hitting too many blocks, or simply dissipating), the contents will also be dropped.

RedstoneFlux

A laser carrying RF will deposit some of its power into any tileentity that can accept power (from that side). Only some of the power is deposited, allowing you to power a line of machines, all with one Laser Relay. If the tileentity cannot accept any more power, it will be ignored (meaning that lasers will pass right through full machines).

The following formula is used to determine how much RF can be deposited:

powerDepositied = Math.min(laserPowerLeft / Math.max(blocksLaserCanPierce, 1), powerMachineCanAccept)

Where:

  • laserPowerLeft is how much power is available to transmit. This is reduced by powerDeposited each time the laser deposits some power

  • blocksLaserCanPierce is how many blocks the laser can pass through. This starts at 5 and is reduced by 1 each time the laser hits a block. When this reaches 0, the laser dissipates

  • powerMachineCanAccept is how much RF the machine can accept in this tick

Some real-world examples:

A laser relay fires off a single laser. The laser contains 100RF.

The first machine is hit. 
It is completely empty (so we'll ignore how much it can accept, and just assume that it will be as much as we give it).

powerDeposited = Math.min(100 / 5, infinite)        [Math.max(blocksLaserCanPierce, 1) = 5 and powerMachineCanAccept is assumed infinite]
               = 20RF

So the first machine receives 20 RF from this laser, 
and the laser now has 80RF left, and can pierce 4 blocks

The second machine is hit. It also is completely empty.
powerDeposited = 80 / 4
               = 20RF

This machine also receives 20 RF. If you continue this further, 
you'll see that each machine hit (if only machines are hit) will 
receive the same amount of power, until the laser dissipates (after 5 things hit)

Keep in mind that with things such as server lag and anything networking, 
it's more than probable that a single machine will 
be hit by the same laser "twice", and will therefore receive double the RF
A laser relay fires off a single laser. The laser contains 100RF.
The first machine is it. It can only accept 10RF.
powerDeposited = Math.min(100 / 5, 10)
               = 10RF

So this machine receives 10RF (and thus filling it), and the laser now has 90RF left.

Hitting the second machine (which is empty),
powerDeposited = 90 / 4
               = 22.5
               = 22RF (as RF can only be a whole number)

So this machine receives 22RF, and the laser now has 68RF left.

Continuing this (and assuming that all remaining machines are empty):
    - machine 3 gets 22RF
    - machine 4 gets 23RF
    - machine 5 gets 23RF

Again, all power is shared evenly between things hit.
A laser relay fires off a single laser. The laser contains 100RF.
The laser hits 2 blocks before hitting the first machine.

2 blocks have been hit, so the laser can only pierce 3 more things.

The first machine is hit.
powerDeposited = 100 / 3
               = 33RF

The second machine is hit.
powerDeposited = 66 / 2
               = 33RF

The third machine is hit.
powerDeposited = 33RF

So you can see that no RF was lost, even though block were hit.

If a block was hit last, and NOT the 3rd machine, the remaining power in the laser would be lost.

Updated